package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.financing.wap.dto.DstUserSubscribeLogDTO;
import com.financing.wap.service.IDstUserSubscribeLogService;
import com.financing.wap.dao.IDstUserSubscribeLogDao;
/**
 * dst_user_subscribe_log  
 * 用户订阅记录表 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Service("dstUserSubscribeLogService")
public class DstUserSubscribeLogServiceImpl implements IDstUserSubscribeLogService{

	@Autowired
	private IDstUserSubscribeLogDao dstUserSubscribeLogDao;

	@Override
	public int insert(DstUserSubscribeLogDTO dstUserSubscribeLog) throws SQLException {
		return dstUserSubscribeLogDao.insert(dstUserSubscribeLog);
	}

	@Override
	public void update(DstUserSubscribeLogDTO dstUserSubscribeLog) throws SQLException {
		dstUserSubscribeLogDao.update(dstUserSubscribeLog);
	}

	@Override
	public void updateForce(DstUserSubscribeLogDTO dstUserSubscribeLog) throws SQLException {
		dstUserSubscribeLogDao.updateForce(dstUserSubscribeLog);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		dstUserSubscribeLogDao.delete(id);
	}
	
	@Override
	public List<DstUserSubscribeLogDTO> queryList(DstUserSubscribeLogDTO dstUserSubscribeLog) throws SQLException {
		return dstUserSubscribeLogDao.queryList(dstUserSubscribeLog);
	}

	@Override
	public int queryListCount(DstUserSubscribeLogDTO dstUserSubscribeLog) throws SQLException {
		return dstUserSubscribeLogDao.queryListCount(dstUserSubscribeLog);
	}

	@Override
	public DstUserSubscribeLogDTO loadById(Integer id) throws SQLException {
		return dstUserSubscribeLogDao.loadById(id);
	}
 	@Override
	public DstUserSubscribeLogDTO queryListGetFirst(DstUserSubscribeLogDTO dstUserSubscribeLog)
			throws SQLException {
		 List<DstUserSubscribeLogDTO> queryList = queryList(dstUserSubscribeLog);
		 if(queryList==null||queryList.size()==0){
			 return new DstUserSubscribeLogDTO();
		 }
		 return queryList.get(0);
	}
}
